# -*- coding: utf-8 -*-
# @Time : 2022/4/9 20:47
# @Author : Liuqing
# @File : 18_合并两个字典.py
# @Software : PyCharm
def merge_two_dicts(a, b):
    c = a.copy()
    c.update(b)
    return c


def merge_dictionaries(a, b):
    return {**a, **b}


if __name__ == '__main__':
    a = {'x': 1, 'y': 2}
    b = {'y': 3, 'z': 4}
    print(merge_two_dicts(a, b))
    print(merge_dictionaries(a, b))
